<template>
  <el-form :inline="true" size="small">
    <el-form-item label="开始时间">
      <el-date-picker
        v-model="startProxy"
        type="date"
        placeholder="开始时间"
        value-format="YYYY-MM-DD"
      />
    </el-form-item>
    <el-form-item label="结束时间">
      <el-date-picker
        v-model="endProxy"
        type="date"
        placeholder="结束时间"
        value-format="YYYY-MM-DD"
      />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="$emit('query')">查询</el-button>
    </el-form-item>
  </el-form>
</template>

<script setup>
import { computed } from 'vue'

const props = defineProps({
  start: String,
  end: String
})

const emits = defineEmits(['update:start', 'update:end', 'query'])

const startProxy = computed({
  get: () => props.start,
  set: value => emits('update:start', value)
})

const endProxy = computed({
  get: () => props.end,
  set: value => emits('update:end', value)
})
</script>